package com.example.techstudy.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;

/**
 * @author: ls
 * @date: 2022/3/23
 * @description:
 */
public abstract class AbstractExecutor {

    @Autowired
    private StudentService studentService;

    @Async("threadPoolTaskExecutor")
    public void exec(){
        before();
        doExec();
    }

    private void before(){
        studentService.create(null);
    }

    protected abstract void doExec();
}
